<template>
  <div id="app">
    <NewBook :addBook="list"></NewBook>
    <BookList :list="list"></BookList>
  </div>
</template>

<script>
import NewBook from "./components/NewBook.vue";
import BookList from "./components/BookList.vue";

export default {
  name: "App",
  data() {
    return {
      list: [],
    };
  },
  components: { NewBook, BookList },
  created() {
    this.$axios({
      url: "/api/getbooks",
    }).then((res) => {
      console.log(res);
      this.list = res.data.data;
      console.log(this.list);
    });
  },
};
</script>

<style></style>
